﻿#ifndef NETWORKUSE_H
#define NETWORKUSE_H

#include <QBaseEntity>

class NetworkUse : public QBaseEntity
{
    Q_OBJECT

    Q_PROPERTY(QString name READ getName WRITE setName)
    Q_PROPERTY(QString description READ getDescription WRITE setDescription)
    Q_PROPERTY(QString macAddress READ getMacAddress WRITE setMacAddress)
    Q_PROPERTY(quint64 bytesReceived READ getBytesReceived WRITE setBytesReceived)
    Q_PROPERTY(quint64 bytesSent READ getBytesSent WRITE setBytesSent)
    Q_PROPERTY(double downloadRate READ getDownloadRate WRITE setDownloadRate)
    Q_PROPERTY(double uploadRate READ getUploadRate WRITE setUploadRate)
    Q_PROPERTY(QDateTime timestamp READ getTimestamp WRITE setTimestamp)

public:
    explicit NetworkUse(QObject *parent = nullptr);

    QString getName() const;
    void setName(const QString &value);

    QString getDescription() const;
    void setDescription(const QString &value);

    QString getMacAddress() const;
    void setMacAddress(const QString &value);

    quint64 getBytesReceived() const;
    void setBytesReceived(quint64 value);

    quint64 getBytesSent() const;
    void setBytesSent(quint64 value);

    double getDownloadRate() const;
    void setDownloadRate(double value);

    double getUploadRate() const;
    void setUploadRate(double value);

    QDateTime getTimestamp() const;
    void setTimestamp(const QDateTime &value);

private:
    QString name;                  // 接口名称
    QString description;
    QString macAddress;
    quint64 bytesReceived = 0;     // 下载字节数（接收）
    quint64 bytesSent = 0;         // 上传字节数（发送）
    double downloadRate = 0.0;     // 下载速率（单位：字节/秒）
    double uploadRate = 0.0;       // 上传速率（单位：字节/秒）
    QDateTime timestamp;           // 时间戳
};

#endif // NETWORKUSE_H
